﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AdventureWorks.Business
{
	public struct ProductFilter
	{
		public String SortOrder { get; set; }
		public String SearchString { get; set; }
		public int ProductCategoryID { get; set; }
		public int ProductModelID { get; set; }

		public static ProductFilter CreateProductFilter(string sortOrder, String searchString, int? productCategoryID, int? productModelID)
		{
			var productFilter = new ProductFilter
			{
				SortOrder = sortOrder,
				SearchString = searchString,
				ProductCategoryID = productCategoryID.GetValueOrDefault(),
				ProductModelID = productModelID.GetValueOrDefault()
			};

			return productFilter;
		}

	}
}
